package com.kyrie.lib_sys.application.syslogApplys;


import com.kyrie.lib_sys.annotation.logAnnotation.LogRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class LogRecordServiceImpl implements LogRecordService {
    
    @Autowired
    private LogRecordMapper logRecordMapper;
    
    @Async
    @Override
    public void saveLog(LogRecord logRecord) {
        try {
            logRecordMapper.insert(logRecord);
        } catch (Exception e) {
            // 日志记录失败不应该影响主业务流程
            System.err.println("保存操作日志失败: " + e.getMessage());
        }
    }


}
